package com.feign;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by qhe on 2018/7/30.
 */
@RestController
public class ConsumerController {

    @Autowired
    private HelloService helloService;

    @RequestMapping(value = "/hello",method = RequestMethod.GET)
    public String helloConsumer(){
        return helloService.hello();
    }


    @RequestMapping(value = "/hello_name",method = RequestMethod.GET)
    public String index(){
        return helloService.index("feignName");
    }

    @RequestMapping(value = "/hello_age",method = RequestMethod.GET)
    public String index2(){
        return helloService.index("Name",11);
    }


    @RequestMapping(value = "/hello_user",method = RequestMethod.GET)
    public String index3(){
        User user = new User("haha",12);
        return helloService.index(user);
    }
}
